#ifndef QUEUE_H_INCLUDED
#define QUEUE_H_INCLUDED

#include <stdlib.h>
#include <string.h>

#define QUEUE_MAX_PRI 0
#define QUEUE_NORM_PRI 1
#define QUEUE_LOW_PRI 2

//Data structure for holding one element in PQueue
typedef struct _e {
    void *data;
    int priority;
    struct _e *next;
} ELEMENT;

typedef struct {
    ELEMENT *head;          //reference to first element
    ELEMENT *tail;          //reference to last element
    int elements;
} PQueue;

extern PQueue* queue_new(void);
extern void queue_free(PQueue *);
extern void queue_enqueue(PQueue *, void *, int);
extern void* queue_dequeue(PQueue *);
extern void* queue_front(PQueue *);
extern int queue_has_next(PQueue *);
extern int queue_size(PQueue *);


#endif
